Tragectories and Variations of Family Decision Making Across Countires

In this piece, I will further demonstrate my graphing abilities.

What is Family Decision Making

As previously stated, adolescents were presented with a variety o topics that families with adolescents often have to make decisions about, and chose the answer that best reflected who made most of the decisions on each topic. The scale ranged from 1 (My parents decide this without discussing it with me) to 5 (I decide this without discussing it with my parents), with 3 representing a joint decision (My parents and I make the decision together). Adolescents were asked these questions at three timepoints, two years and three years after the initial observation.

Data Being Used

Several different variables were used for the following analyses. Alongside Family Decision Making (FDM), Age (Age), Socio-economic Status (SES), Gender (ChGender), and Country of origin (Country) were used to help identify potential trends in the data. Below are the countries utilized in this dataset.

levels(data$Country)
##  [1] "USA-Hispanic"          "China-Jinan"           "China-Shanghai"       
##  [4] "Italy-Naples"          "Italy-Rome"            "Kenya"                
##  [7] "Philippines"           "Thailand"              "Sweden"               
## [10] "USA-African American"  "USA-European American" "Colombia"             
## [13] "Jordan"                "China-Chongqing"

Plotting Family Decision Making

I can begin by making a plot of Age and Family Decision Making.

data %>%
ggplot(
  aes(x=Age_Exact, 
      y = FDM, 
      group = Country, 
      color = Country)) + 
  geom_line(stat = "summary", fun = "mean") +
  theme_bw() +
  scale_color_manual(values=c("#000000","#ff0000","#8F00FF", "#0bb4ff", "#50e991", "#e6d800", "#fb19f5", "#ffa300", "#dc0ab4", "#0000fB", "#b3d4ff", "#00bfa0", "#00ffff")) +
  labs(
    x = "Age", 
    y = "Family Decision Making", 
    color = "Country",
    title = "Age and Country Effects on Family Decision Making")

This plot is ok, but there are majors ways to improve it. There is no rhyme or reason to the colors included, and it’s hard to visualize the trend of “Family Decision Making increases as adolescents increase in age.”

My first suggestion is to smooth out the lines.

data %>%
ggplot(
  aes(x=Age_Exact, 
      y = FDM, 
      group = Country, 
      color = Country)) + 
  geom_smooth(
    size = .5,
    span = 1,
    se = FALSE) +
  theme_bw() +
  scale_color_manual(values=c("#000000","#ff0000","#8F00FF", "#0bb4ff", "#50e991", "#e6d800", "#fb19f5", "#ffa300", "#dc0ab4", "#0000fB", "#b3d4ff", "#00bfa0", "#00ffff")) +
  labs(
    x = "Age", 
    y = "Family Decision Making", 
    color = "Country",
    title = "Age and Country Effects on Family Decision Making")

This had the effect of minimizing the noise of the first graph. It is easier to see the overall positive linear trend of Family Decision Making as adolescents get older.

The next suggestion is to combine some of the data. For example, we can combine the United states ethnicities to create one USA line.

Country_Collapse <- data %>%
  mutate(Country = case_when(
    Country %in% c("USA-African American", "USA-European American", "USA-Hispanic") ~ "United States",
    Country %in% c("China-Shanghai", "China-Chongqing") ~ "China",
    Country %in% c("Italy-Naples", "Italy-Rome") ~ "Italy",
    Country == "Kenya" ~ "Kenya",
    Country == "Philippines" ~ "Philippines",
    Country == "Thailand" ~ "Thailand",
    Country == "Sweden" ~ "Sweden",
    Country == "Colombia" ~ "Colombia",
    Country == "Jordan" ~ "Jordan",
    Country == "India" ~ "India"
  ))

Now we can create a plot that just reflects countries.

Country_Collapse %>%
ggplot(
  aes(x=Age_Exact, 
      y = FDM, 
      group = Country, 
      color = Country)) + 
  geom_smooth(
    aes(group = 1),
    method = "loess",
    formula = y~x,
    se = TRUE,
    alpha = .2,
    color = "black",
    size = .5
  ) +
  geom_smooth(
    size = .5,
    span = 1,
    se = FALSE
    ) +
  theme_bw() +
  scale_color_manual(values=c("#ff0000","#8F00FF", "#0bb4ff", "#50e991", "#e6d800", "#fb19f5", "#ffa300", "#0000fB", "maroon", "#00bfa0")) +
  labs(
    x = "Age", 
    y = "Family Decision Making", 
    color = "Country",
    title = "Country Effects on Family Decision Making Over Time")

This helped clean up some of the clutter of the extra lines. I also included the average FDM line to help show the distinct differences across countries.

Country_Collapse <- Country_Collapse %>%
  mutate(Index1 = case_when(
    Index1 == "1" ~ "Time 1",
    Index1 == "2" ~ "Time 2",
    Index1 == "3" ~ "Time 3"
  ))
view(Country_Collapse)

Country_Collapse %>% ggplot(
  aes(x=Age_Exact, 
      y = FDM, 
      group = Country, 
      color = Country)) + 
  geom_smooth(
    aes(group = 1),
    method = "loess",
    formula = y~x,
    se = TRUE,
    alpha = .2,
    color = "black",
    size = .5
  ) +
  facet_wrap(~Index1, scales = "free") +
  geom_smooth(
    size = .5,
    span = 1,
    se = FALSE
    ) +
  theme_bw() +
  scale_color_manual(values=c("#ff0000","#8F00FF", "#0bb4ff", "#50e991", "#e6d800", "#fb19f5", "#ffa300", "#0000fB", "maroon", "#00bfa0")) +
  labs(
    x = "Age", 
    y = "Family Decision Making", 
    color = "Country",
    title = "Country Effects on Family Decision Making Over Time")

The benefit of this method is we can hilight the fact that this was longitudinal data. We can more easily see how the data changes across time. For comparison, the plot below has the axes locked across all plots. That can help us see changes that aren’t warped by the axes.

A final way we can look at the data is using a spaghetti plot. A spaghetti plot takes all individual observations and plots them onto the graph.

Country_Collapse %>% ggplot(
  aes(x=Age_Exact, 
      y = FDM, 
      group = ID, 
      color = Country)) + 
 geom_smooth(
    size = .5,
    span = 1,
    se = FALSE,
    show.legend = FALSE
    ) +
facet_wrap(~Country, scales = "free") +
  theme_bw() +
scale_color_manual(values=c("#ff0000","#8F00FF", "#0bb4ff", "#50e991", "#e6d800", "#fb19f5", "#ffa300", "#0000fB", "black", "#00bfa0")) +
  labs(
    x = "Age", 
    y = "Family Decision Making", 
    color = "Country",
    title = "Country Effects on Family Decision Making Over Time")+
  theme(plot.title = element_text(size = 20),
        axis.title = element_text(size = 15),
        axis.text = element_text(size = 12))

As this graph currently stands, I would only use it to demonstrate that there is a lot of variation within each country. It can look confusing to the readers and be hard to understand.

model.FDM_outcome <- lmer(FDM ~  SES + ChGender + AgeCM + Country + AgeCM*Country + (1|ID), data = data)
anova(model.FDM_outcome)
## Type III Analysis of Variance Table with Satterthwaite's method
##                Sum Sq Mean Sq NumDF  DenDF  F value    Pr(>F)    
## SES            210.27  210.27     1 1006.8  23.2548 1.638e-06 ***
## ChGender         0.19    0.19     1 1014.0   0.0207    0.8855    
## AgeCM         2930.62 2930.62     1 2190.8 324.1164 < 2.2e-16 ***
## Country       2400.17  218.20    11 1190.7  24.1319 < 2.2e-16 ***
## AgeCM:Country  553.45   50.31    11 2190.6   5.5645 7.506e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model.FDM_outcome)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: FDM ~ SES + ChGender + AgeCM + Country + AgeCM * Country + (1 |  
##     ID)
##    Data: data
## 
## REML criterion at convergence: 15854.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.8118 -0.4904  0.0963  0.5901  3.5643 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  ID       (Intercept) 3.697    1.923   
##  Residual             9.042    3.007   
## Number of obs: 2981, groups:  ID, 1119
## 
## Fixed effects:
##                                      Estimate Std. Error         df t value
## (Intercept)                           2.28019    0.46980 1062.29682   4.854
## SES                                   0.10523    0.02182 1006.83378   4.822
## ChGender                              0.02333    0.16198 1014.04082   0.144
## AgeCM                                 0.53196    0.13691 2368.84373   3.886
## CountryChina-Shanghai                 0.60526    0.53443 1877.02334   1.133
## CountryItaly-Naples                   1.40722    0.42095 1092.17043   3.343
## CountryItaly-Rome                     1.53611    0.41807 1091.26599   3.674
## CountryKenya                         -2.54390    0.42817 1114.33503  -5.941
## CountryPhilippines                   -1.79553    0.42835 1145.04726  -4.192
## CountryThailand                       0.48907    0.41948 1113.19635   1.166
## CountrySweden                         2.74364    0.49327 1511.39771   5.562
## CountryUSA-African American           0.16585    0.43659 1206.49150   0.380
## CountryUSA-European American          0.54703    0.45941 1199.06752   1.191
## CountryColombia                       0.42612    0.42796 1094.91660   0.996
## CountryJordan                        -1.11082    0.42535 1191.60142  -2.612
## AgeCM:CountryChina-Shanghai           0.53572    0.19412 2387.45660   2.760
## AgeCM:CountryItaly-Naples            -0.07163    0.18641 2201.01963  -0.384
## AgeCM:CountryItaly-Rome               0.22528    0.17696 2363.99111   1.273
## AgeCM:CountryKenya                   -0.08203    0.17078 2373.04173  -0.480
## AgeCM:CountryPhilippines              0.17248    0.18048 2252.35532   0.956
## AgeCM:CountryThailand                 0.92344    0.19376 2295.29244   4.766
## AgeCM:CountrySweden                  -0.06904    0.21534 2221.84049  -0.321
## AgeCM:CountryUSA-African American    -0.06917    0.17893 2302.28030  -0.387
## AgeCM:CountryUSA-European American    0.03415    0.17706 2259.63394   0.193
## AgeCM:CountryColombia                 0.17162    0.18671 2276.81360   0.919
## AgeCM:CountryJordan                  -0.17478    0.19047 2157.65051  -0.918
##                                    Pr(>|t|)    
## (Intercept)                        1.39e-06 ***
## SES                                1.64e-06 ***
## ChGender                           0.885502    
## AgeCM                              0.000105 ***
## CountryChina-Shanghai              0.257553    
## CountryItaly-Naples                0.000857 ***
## CountryItaly-Rome                  0.000250 ***
## CountryKenya                       3.78e-09 ***
## CountryPhilippines                 2.98e-05 ***
## CountryThailand                    0.243903    
## CountrySweden                      3.15e-08 ***
## CountryUSA-African American        0.704108    
## CountryUSA-European American       0.234000    
## CountryColombia                    0.319609    
## CountryJordan                      0.009127 ** 
## AgeCM:CountryChina-Shanghai        0.005829 ** 
## AgeCM:CountryItaly-Naples          0.700819    
## AgeCM:CountryItaly-Rome            0.203124    
## AgeCM:CountryKenya                 0.631053    
## AgeCM:CountryPhilippines           0.339340    
## AgeCM:CountryThailand              2.00e-06 ***
## AgeCM:CountrySweden                0.748552    
## AgeCM:CountryUSA-African American  0.699120    
## AgeCM:CountryUSA-European American 0.847078    
## AgeCM:CountryColombia              0.358091    
## AgeCM:CountryJordan                0.358927    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation matrix not shown by default, as p = 26 > 12.
## Use print(x, correlation=TRUE)  or
##     vcov(x)        if you need it
tab_model(model.FDM_outcome)
  FDM
Predictors Estimates CI p
(Intercept) 2.28 1.36 – 3.20 <0.001
Highest education out of
both parents
0.11 0.06 – 0.15 <0.001
Child Gender 0.02 -0.29 – 0.34 0.885
Childs Age in Yrs at
Child Interview-not
rounded
0.53 0.26 – 0.80 <0.001
Country: China-Shanghai 0.61 -0.44 – 1.65 0.258
Country: Italy-Naples 1.41 0.58 – 2.23 0.001
Country: Italy-Rome 1.54 0.72 – 2.36 <0.001
Country: Kenya -2.54 -3.38 – -1.70 <0.001
Country: Philippines -1.80 -2.64 – -0.96 <0.001
Country: Thailand 0.49 -0.33 – 1.31 0.244
Country: Sweden 2.74 1.78 – 3.71 <0.001
Country: USA-African
American
0.17 -0.69 – 1.02 0.704
Country: USA-European
American
0.55 -0.35 – 1.45 0.234
Country: Colombia 0.43 -0.41 – 1.27 0.319
Country: Jordan -1.11 -1.94 – -0.28 0.009
AgeCM:CountryChina-Shanghai 0.54 0.16 – 0.92 0.006
AgeCM:CountryItaly-Naples -0.07 -0.44 – 0.29 0.701
AgeCM:CountryItaly-Rome 0.23 -0.12 – 0.57 0.203
AgeCM:CountryKenya -0.08 -0.42 – 0.25 0.631
AgeCM:CountryPhilippines 0.17 -0.18 – 0.53 0.339
AgeCM:CountryThailand 0.92 0.54 – 1.30 <0.001
AgeCM:CountrySweden -0.07 -0.49 – 0.35 0.749
AgeCM:CountryUSA-African American -0.07 -0.42 – 0.28 0.699
AgeCM:CountryUSA-European American 0.03 -0.31 – 0.38 0.847
AgeCM:CountryColombia 0.17 -0.19 – 0.54 0.358
AgeCM:CountryJordan -0.17 -0.55 – 0.20 0.359
Random Effects
σ2 9.04
τ00 ID 3.70
ICC 0.29
N ID 1119
Observations 2981
Marginal R2 / Conditional R2 0.229 / 0.453